<include file="Public:header" />
<load href="__JS__/upload/uploadify.css" />
<load href="__JS__/swfobject.js" />
<script type="text/javascript" src="__JS__/jquery.uploadify.v2.1.4.min.js"></script> 
<script type="text/javascript" src="__JS__/jianfanzhuanhuan.js"></script>
<div class="content">
<!-----------------------------------------内容开始--------------------------------------------------->
<div class="infoBox">
<form name="form" action="{:U('dotou')}" method="post" onsubmit="return checkform();">
<input type="hidden" name="id" value="{$id}" />
<style>
.infoBoxTd{width:15%;min-width:100px;}
.checkboxml{margin-left:10px;}
.fred{color:#CC0000;}
.zishutishi{width:400px;height:80px;line-height:80px;font-size:22px;padding:0px 40px;color:#f00;background:url(__PUBLIC__/images/btm_bg_hei.png) repeat;position:fixed;left:20%;top:20%;z-index:999;display:none;}
</style>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td class="infoBoxTd">&nbsp;</td>
		<td align="left"><a href="./index.php?a=toup&m=toup&tid={$id}" target="_blank" class="buttom" >预览</a></td>
	</tr>
	<tr>
		<td class="infoBoxTd">&nbsp;</td>
		<td align="left"><a href="javascript:;" class="buttom auto_paiban_textarea" >自动排版</a></td>
	</tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0" id="basic">

<tr>
	<td class="infoBoxTd">前台报名参赛：</td>
	<td colspan="2">
	<input type="radio" name="baoming" value="0" checked="checked" >不需要 <input type="radio" name="baoming" value="1" <eq name="baoming" value="1"> checked="checked"</eq> >需要 
	</td>
</tr>
<tr>
	<td class="infoBoxTd">投票主题：</td>
	<td colspan="2">
	<INPUT name="name" value='{$name|stripslashes}' class="formTitle xzzsinput" size="80" maxlength="150" onkeyup="word_count(150,this)" onblur="auto_save('name')" >您已输入<span class="fred ysrzs">0</span>字，还可输入<span class="fred syzs">150</span>字。
	<br />
	<a href="javascript:;" onclick="zhuanjft(this)" class="buttom" style="margin-top:5px;"  >自动转换简繁体</a>
	</td>
</tr>
<volist name="lang_name" id="lang_name">
<tr>
<td width="11%" class="infoBoxTd">投票主题（<span class="lang_name" lang_daihao="{$lang_name.nid}">{$lang_name.name}</span>）：</td>
<td colspan="2">
<input type="text" name="name{$lang_name.id}" value='{$lang_name.menu_name|stripslashes}' class="formTitle xzzsinput" size="80" maxlength="150" onkeyup="word_count(150,this)" onblur="auto_save('name{$lang_name.id}')" style="float:left;margin-right:10px;" />您已输入<span class="fred ysrzs">0</span>字，还可输入<span class="fred syzs">150</span>字。
<br />
<eq name="lang_name.nid" value="L01"> <a href="javascript:;" onclick="zhuanft(this)" class="buttom" style="margin-top:5px;"  >将简体转换为繁体</a></eq>
</td>
</tr>
</volist>

<tr>
    <td class="infoBoxTd" >文章内容：</td>
    <td colspan="2">
		<textarea id="content" name="content" style="width:800px;height:300px;" class="sauto_save_textarea">{$content|stripslashes}</textarea>
		<br />
		<a href="javascript:;" onclick="zhuanjft(this)" class="buttom"  >自动转换简繁体</a>
		<div>
			您已输入<span id="word_count1" class="fred">0</span>字，还可输入<span id="word_yu1" class="fred">9000</span>字。最多上传<span class="fred">20</span>张图。
		</div>
		<div class="zishutishi" id="zishutishi1"></div>
	</td>
</tr>
<volist name="lang_content" id="lang_content">
<tr>
    <td class="infoBoxTd" >文章内容（<span class="lang_name" lang_daihao="{$lang_content.nid}">{$lang_content.name}</span>）：</td>
    <td colspan="2">
		<textarea id="content{$lang_content.id}" name="content{$lang_content.id}" style="width:800px;height:300px;" class="sauto_save_textarea">{$lang_content.menu_content|stripslashes}</textarea>
		<br />
		<eq name="lang_content.nid" value="L01"> <a href="javascript:;" onclick="zhuanft(this)" class="buttom" >将简体转换为繁体</a></eq>
		<div>
			您已输入<span id="word_count00{$lang_content.id}" class="fred">0</span>字，还可输入<span id="word_yu00{$lang_content.id}" class="fred">9000</span>字。最多上传<span class="fred">20</span>张图。
		</div>
		<div class="zishutishi" id="zishutishi00{$lang_content.id}"></div>
	</td>
	<script type="text/javascript">
	//编辑器
	var k00{$lang_content.id}; //文章内容
	KindEditor.ready(function(K) {
		k00{$lang_content.id} = K.create('#content{$lang_content.id}', {
			allowFileManager : true,
			afterChange : function() {
				K('#word_count00{$lang_content.id}').html(this.count('text'));
				$('#word_yu00{$lang_content.id}').html(9000-this.count('text'));
				if(this.count('text')>9000){
					$("#zishutishi00{$lang_content.id}").show();
					$("#zishutishi00{$lang_content.id}").text("超出字数限制！无法保存！");
				}else{
					$("#zishutishi00{$lang_content.id}").hide();
					$("#zishutishi00{$lang_content.id}").text("");
				}
			}
		});
	});
	</script>
</tr>
</volist>

</table>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td class="infoBoxTd">&nbsp;</td>
		<td align="left"><a href="./index.php?a=toup&m=toup&tid={$id}" target="_blank" class="buttom" >预览</a></td>
	</tr>
	<tr>
		<td class="infoBoxTd">&nbsp;</td>
		<td align="left"><a href="javascript:;" class="buttom auto_paiban_textarea" >自动排版</a></td>
	</tr>
	<tr>
		<td class="infoBoxTd">&nbsp;</td>
		<td align="left">
			<php>
			if(!$state){
			</php>
				<input type="submit" name="Button1" value="提交审核" class="formInput01" />
			<php>
			}else{
			</php>
				<input type="submit" name="Button1" value="保存" class="formInput01" />
			<php>
			}
			</php>
		</td>
	</tr>
</table>

</form>
</div>
<!-----------------------------------------内容结束--------------------------------------------------->
</div>
<script language="javascript">
//字数限制js

function word_count(t,obj){
	var wordleng=$(obj).val().length;
	var syzs=t-wordleng;
	$(obj).parent().find('span.ysrzs').text(wordleng);
	$(obj).parent().find('span.syzs').text(syzs);
}
$(document).ready(function(){
	$("input.xzzsinput").each(function(){
		var wordleng=$(this).val().length;
		var syzs=$(this).parent().find('span.syzs').text()-wordleng;
		$(this).parent().find('span.ysrzs').text(wordleng);
		$(this).parent().find('span.syzs').text(syzs);
	});
	
});
//编辑器
var k1; //文章内容
KindEditor.ready(function(K) {
	k1 = K.create('#content', {
		allowFileManager : true,
		afterChange : function() {
			K('#word_count1').html(this.count('text'));
			$('#word_yu1').html(3000-this.count('text'));
			if(this.count('text')>3000){
				$("#zishutishi1").show();
				$("#zishutishi1").text("超出字数限制！无法保存！");
			}else{
				$("#zishutishi1").hide();
				$("#zishutishi1").text("");
			}
		}
	});
});

//表单验证
function checkform(){
	var n = $('input[name="name"]').val();
	if(n == ''){
		ui.error('请输入投票主题');
		return false;
	}
	if($('.zishutishi').text()!=''){
		return false;exit;
	}
}
$(document).ready(function(){
	//点击自动排版按钮时，为各个编辑器自动排版 图片和文字段落宽度都是650px
	$(".auto_paiban_textarea").on("click",function(){

		$("textarea").each(function(){
			$(this).parent().find("iframe").contents().find("body img").css('text-indent',"0");
			$(this).parent().find("iframe").contents().find("body img").css("height","auto");
			$(this).parent().find("iframe").contents().find("body img").css("width","100%");
			$(this).parent().find("iframe").contents().find("body p").css('text-indent',"0");
			$(this).parent().find("iframe").contents().find("body span").css('text-indent',"0");
			$(this).parent().find("iframe").contents().find("body p").css('font-size',"14px");
			$(this).parent().find("iframe").contents().find("body span").css('font-size',"14px");
			$(this).parent().find("iframe").contents().find("body p").css('color',"#333");
			$(this).parent().find("iframe").contents().find("body span").css('color',"#333");
//			$(this).parent().find("iframe").contents().find("body p").css('margin',"0");
//			$(this).parent().find("iframe").contents().find("body span").css('margin',"0");
			$(this).parent().find("iframe").contents().find("body p").css('font-family',"'Helvetica','SimHei'");
			$(this).parent().find("iframe").contents().find("body span").css('font-family',"'Helvetica','SimHei'");
			$(this).parent().find("iframe").contents().find("body img").css('margin',"0 auto");
		});
	}); 

});

</script>
    

<include file="Public:footer" />
